package site.seean.springboot.kafka.controller;

import site.seean.springboot.kafka.producer.Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xs
 * @Description:
 * @Date: 2019/12/04 11:26
 */
@RestController
@RequestMapping("/kafka")
public class SendController {

    @Autowired
    private Producer producer;

    @RequestMapping(value = "/send")
    public String send() {
        producer.sendMessage("topic-test1","{\"code\":200}");
        return "{\"code\":200}";
    }
}
